console.log(document.firstChild.nodeName);

console.log("======");

console.log(document.lastChild.nodeName)

console.log("======");

let child = document.childNodes;
for (let i = 0; i < child.length; i++) {
    const node = child[i];
    console.log(`${node.nodeName} - ${node.nodeType} - ${node.nodeValue}`);
}

console.log("======");

let childHtml = child[1].childNodes;
for (let i = 0; i < childHtml.length; i++) {
    const node = childHtml[i];
    console.log(`${node.nodeName} - ${node.nodeType} - ${node.nodeValue}`);
}

console.log("======");

let childBody = childHtml[2].childNodes;
for (let i = 0; i < childBody.length; i++) {
    const node = childBody[i];
    console.log(`${node.nodeName} - ${node.nodeType} - ${node.nodeValue}`);
}

console.log("======");

// let p = document.lastChild.lastChild.firstChild.nextSibling.nextSibling.nextSibling;
let p = document.lastChild.lastChild.lastChild.previousSibling;
console.log(`${p.textContent}`);

p.appendChild(p.cloneNode(true));

p.parentNode.appendChild(p.cloneNode(true));
p.parentNode.insertBefore(p.firstChild.cloneNode(true), p);

console.log(p.hasChildNodes());